<?php

ob_start();
$db = new PDO('mysql:host=172.18.0.4;dbname=app.test', 'root', 'root');
$stmt = $db->prepare("select * from test where id = ?");
$stmt->bindColumn(1, $type, PDO::PARAM_STR, 256);
$stmt->bindColumn(2, $lob, PDO::PARAM_LOB);
$stmt->execute([$_GET['id'] ?? 1]);
$stmt->fetch(PDO::FETCH_BOUND);
ob_clean();

header("Content-Type: $type");
echo $lob; // fpassthru reports an error that $lob is not a stream so echo is used in place.
ob_end_flush();
sleep(5);
